﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Grid.Extensions
{
    public class DataGridViewFontColumn : DataGridViewColumn
    {
        public DataGridViewFontColumn()
            : base(new DataGridViewFontCell())
        {
            //DefaultFont = new Font("Arial", 10);
        }

        public override DataGridViewCell CellTemplate
        {
            get
            {
                return base.CellTemplate;
            }
            set
            {
                // Ensure that the cell used for the template is a DataGridViewFontCell.
                if (value != null &&
                    !value.GetType().IsAssignableFrom(typeof(DataGridViewFontCell)))
                {
                    throw new InvalidCastException("Must be a DataGridViewFontCell");
                }
                base.CellTemplate = value;
            }
        }

        public Font DefaultFont { get; set; }
    }
}
